#include <iostream>
using namespace std;

int secondmax(int array[],int n)
{
	int firstmax = array[0];
	int secondmax = array[0];;
	for(int i=1;i<n;i++)
	{
		if(array[i]>firstmax)
		{
			secondmax = firstmax;
			firstmax = array[i];
		}
	}
	return secondmax;
}

int main()
{
	int array[]={1,2,34,5,67,89,9,8,7,100};
	int length=sizeof(array)/sizeof(array[0]);
	cout<<"length="<<length<<endl;
	cout<<"secondmax="<<secondmax(array,length)<<endl;
	system("pause");
	return 0;
}
